﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:local="clr-namespace:Demo.Controls">
    <Style TargetType="local:Accordion">
        <Setter Property="Foreground" Value="#09EFF4"/>
        <Setter Property="FontSize" Value="12"/>
        <Setter Property="Background">
            <Setter.Value>
                <SolidColorBrush Color="#003366" Opacity="0.6"/>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush" Value="#949494"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:Accordion">
                    <Grid>
                        <Grid.Resources>
                            <Style x:Key="UpDownStyle" TargetType="ToggleButton">
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="ToggleButton">
                                            <Grid Background="Transparent">
                                                <VisualStateManager.VisualStateGroups>
                                                    <VisualStateGroup x:Name="CheckStates">
                                                        <VisualState x:Name="Checked">
                                                            <Storyboard>
                                                                <DoubleAnimation Duration="0:0:0.5" To="180" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="path" d:IsOptimized="True"/>
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Unchecked">
                                                            <Storyboard>
                                                                <DoubleAnimation Duration="0:0:0.5" From="180" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="path"/>
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Indeterminate"/>
                                                    </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <Path x:Name="path" Data="M0.5,13 L6.75,0.5 L13,13 M0.5,19.003006 L6.75,6.503006 L13,19.003006" Fill="Transparent" RenderTransformOrigin="0.5,0.5" Stretch="Fill" Stroke="White" StrokeThickness="2" UseLayoutRounding="False">
                                                    <Path.RenderTransform>
                                                        <CompositeTransform Rotation="0"/>
                                                    </Path.RenderTransform>
                                                </Path>
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </Grid.Resources>
                        <Grid>
                            <local:DockButton x:Name="RightButton" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" DockDirection="Right" Content="{TemplateBinding Title}" HorizontalAlignment="Right" VerticalAlignment="Top" FontSize="{TemplateBinding FontSize}" Foreground="{TemplateBinding Foreground}"/>
                            <local:DockButton x:Name="LeftButton" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" Visibility="Collapsed" Content="{TemplateBinding Title}" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="{TemplateBinding FontSize}" Foreground="{TemplateBinding Foreground}"/>
                            <Grid Margin="0,0,33,0" x:Name="ContentGrid">
                                <Rectangle x:Name="rectangle" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
                                <Rectangle x:Name="rectangle1" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" Height="26" VerticalAlignment="Top" Visibility="Collapsed"/>
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="11,0,0,0">
                                    <ToggleButton x:Name="UpDownButton" HorizontalAlignment="Left" Height="15" Margin="5,6,14,0" Style="{StaticResource UpDownStyle}" VerticalAlignment="Top" Width="15"/>
                                    <TextBlock Text="{TemplateBinding Title}" FontWeight="Bold" FontSize="{TemplateBinding FontSize}" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="2,5,11,0"/>
                                </StackPanel>
                                <ToggleButton x:Name="UpDownButton2" Visibility="Collapsed" HorizontalAlignment="Right" Height="15" Margin="5,6,14,0" Style="{StaticResource UpDownStyle}" VerticalAlignment="Top" Width="15"/>
                                <Grid x:Name="ContentPanel" Margin="10,26,10,10">
                                    <ContentPresenter/>
                                </Grid>
                            </Grid>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
